﻿using System.Collections.ObjectModel;

namespace Helper.Models
{
    public class ExamResultModel:ModelBase
    {
        int examResultID;
        int examID;
        int studentID;
        ObservableCollection<ExamResultSubjectModel> entries;

        public ExamResultModel()
        {
            ExamResultID = 0;
            StudentID = 0;
            ExamID = 0;
            Entries = new ObservableCollection<ExamResultSubjectModel>();
        }
        public int ExamResultID
        {
            get { return this.examResultID; }

            set
            {
                if (value != this.examResultID)
                {
                    this.examResultID = value;
                    NotifyPropertyChanged("ExamResultID");
                }
            }
        }

        public int StudentID
        {
            get { return this.studentID; }

            set
            {
                if (value != this.studentID)
                {
                    this.studentID = value;
                    NotifyPropertyChanged("StudentID");
                }
            }
        }

        public int ExamID
        {
            get { return this.examID; }

            set
            {
                if (value != this.examID)
                {
                    this.examID = value;
                    NotifyPropertyChanged("ExamID");
                }
            }
        }

        public ObservableCollection<ExamResultSubjectModel> Entries
        {
            get { return entries; }

            set
            {
                if (value != this.entries)
                {
                    this.entries = value;
                    NotifyPropertyChanged("Entries");
                }
            }
        }

        public override void Reset()
        {
            ExamResultID = 0;
            StudentID = 0;
            ExamID = 0;
            Entries = new ObservableCollection<ExamResultSubjectModel>();
        }
    }

    public class ExamResultStudentDisplayModel : ExamResultModel
    {
        string nameOfStudent = "";
        string nameOfClass = "";
        string nameOfExam = "";
        public ExamResultStudentDisplayModel()
        {
            NameOfStudent = "";
            NameOfClass = "";
            NameOfExam = "";
        }

        public ExamResultStudentDisplayModel(ExamResultModel examResultModel)
        {
            NameOfStudent = "";
            NameOfClass = "";
            NameOfExam = "";
            this.Entries = examResultModel.Entries;
            this.ExamID = examResultModel.ExamID;
            this.ExamResultID = examResultModel.ExamResultID;
            this.StudentID = examResultModel.StudentID;
        }
        public string NameOfStudent
        {
            get { return this.nameOfStudent; }

            set
            {
                if (value != this.nameOfStudent)
                {
                    this.nameOfStudent = value;
                    NotifyPropertyChanged("NameOfStudent");
                }
            }
        }

        public string NameOfClass
        {
            get { return this.nameOfClass; }

            set
            {
                if (value != this.nameOfClass)
                {
                    this.nameOfClass = value;
                    NotifyPropertyChanged("NameOfClass");
                }
            }
        }

        public string NameOfExam
        {
            get { return this.nameOfExam; }

            set
            {
                if (value != this.nameOfExam)
                {
                    this.nameOfExam = value;
                    NotifyPropertyChanged("NameOfExam");
                }
            }
        }
    }
}
